<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	
	<article class="container container-a1-register clearfix">
		<section class="content">
			<div class="form-register">
				<nav>
					<a id="personal" class="active" href="#"><span >个人账户</span></a><a
						id="enterprise" href="#"><span >企业账户</span></a>
				</nav>
				<div class="forms">
					<form id="form_personal" action="#" method="post" th:action="@{/supplier/changeUser}" th:object="${currentUser}">
						
						<div style="color: red; text-align: center;">  
						</div>
						<input type="hidden" th:value="${currentUser.id}" th:field="*{id}"/>
						<p>
							<label for=""><strong>*</strong>用户昵称 : </label> 
							<input class="input"  type="text" th:value="${currentUser.realName}" id="realName" name="realName"/> 
						</p>
						<p>
							<label for=""><strong>*</strong>用户角色 : </label> 
							<select th:value="${currentUser.roleIds}" class="select" id="role" name="role">
								<option value="1">管理员</option>
								<option value="2">销售员</option>
							</select>
							
							
							
						</p>
						<p>
							<label for="">
							<strong>*</strong>所属企业 : </label>
							
							<select  th:value="${currentUser.tCompany.companyName}"  class="select" name ="companyId" id="companyId">
				              <option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}" th:if="${company.companyName==currentUser.tCompany.companyName}" selected = "selected"></option>
				              <option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}" th:if="${company.companyName!=currentUser.tCompany.companyName}" ></option>
				            </select>
							
							
						</p>
						<p>
							<label for=""><strong>*</strong>手机号码 : </label> 
							
							<input
								class="m-error-text input" th:value="${currentUser.mobilePhone}" type="text" name="mobilePhone" id="mobilePhone"/>
							
						</p>
						
						<!--<p>
                        <label for="">所属语言 : </label>
                        <select class="select" name="" id="">
                            <option value="">中文(简体)</option>
                            <option value="">English</option>
                        </select>
                    </p>-->
						
						
						<!--<p class="btn-bar">
							<label for=""></label> <span>
								<button class="btn btn-cyan" type="submit">修改资料信息</button>
							</span>
						</p>-->
						<p class="btn-bar">
							<label for=""></label> <span>
                            <button class="btn btn-cyan" type="submit">修改并返回上一级</button>
                        </span>
						</p>
					</form>

					<form style="display: none" id="form_enterprise" action="#" method="post" name="form_enterprise" th:action="@{/supplier/changeCompany}" th:object="${company}">
						 <div th:if="${vendor.status == 1}" class="info-tip" ><i></i><span>审核中...</span></div>
                    	 <div th:if="${vendor.status == 5}" class="info-tip info-tip-fail"><i></i><span>审核不通过</span></div>
                         <div th:if="${vendor.status == 2} or ${vendor.status == 3}" class="info-tip info-tip-success"><i></i><span>已通过</span></div>
						 <div th:if="${vendor.status == 4}" class="info-tip info-tip-black" style="background-color:#636363"><i></i><span>黑名单</span></div>
						<input type="hidden" th:value="${currentUser.tCompany.id}" name="companyId" id="companyId"/>
						<p>
							<label for=""><strong>*</strong>企业名称 : </label> 
							
							<input class="input" th:value="${currentUser.tCompany.companyName}" type="text" name="companyName" id="companyName"/>
							
						</p>
						<p>
							<label for=""><strong>*</strong>营业执照号码 : </label>  
							<input class="input" th:value="${currentUser.tCompany.businessId}" name="businessId" id="businessId"/>
							
						</p>
						<div class="div-box clearfix">
							 <label class="label-title" for=""><strong>*</strong>企业所在地 : </label>
                        <div class="div-box-right">
                            <p>
                            	<select  class="select" onchange="changProvince(this)" name="provinceId" id="provinceId">
						              <option th:each="province : ${pList}" th:value="${province.id}" th:text="${province.provinceName}" th:if="${province.provinceName==currentUser.tCompany.tProvince.provinceName}" selected = "selected"></option>
						        	  <option th:each="province : ${pList}" th:value="${province.id}" th:text="${province.provinceName}" th:if="${province.provinceName!=currentUser.tCompany.tProvince.provinceName}"></option>
						        </select>
                            
                                <span class="c-blue" >省</span>
                                <select id="tcity"  class="select" name="tCity" >
						               <option value="option" th:text="${currentUser.tCompany.tCity.cityName}">请选择</option>
						        </select>
                                
                                <span class="c-blue">市</span>
                            </p>
                            <p>
                            	<input class="input" type="text" th:value="${currentUser.tCompany.address}" name="address" id="address"/>
                            </p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>固定电话 : </label> 
							<input
								class="input" type="text" th:value="${currentUser.tCompany.registeredPhone}" name="registeredPhone" id="registeredPhone"/>
						</p>
						<div class="div-box clearfix">
							<label class="label-title" for=""><strong>*</strong>公司主营业务
								: </label>
							<div class="div-box-right">
								 <p>
								 <label th:each="industry,iterationStatus: ${industryList}" name="mainBusiness" id="mainBusiness">
								 <input type="checkbox"  th:text="${industry.industryName}" th:value="${industry.id}" th:if="${industry.industryName==currentUser.tCompany.mainBusiness}" checked="checked"/>
								 <input type="checkbox"  th:text="${industry.industryName}" th:value="${industry.id}" th:if="${industry.industryName!=currentUser.tCompany.mainBusiness}" />
								 </label>	
								 
                            </p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>企业类型 : </label> 
							
							<select  class="select" id="orgType" name="orgType">
				              <option th:each="orgType : ${orgList}" th:value="${orgType.id}" th:text="${orgType.typeName}" th:if="${orgType.typeName!=currentUser.tCompany.tOrganizationType.typeName}" ></option>
				              <option th:each="orgType : ${orgList}" th:value="${orgType.id}" th:text="${orgType.typeName}" th:if="${orgType.typeName==currentUser.tCompany.tOrganizationType.typeName}" selected = "selected"></option>
				            </select>
							
						</p>
						<p>
							<label for="">注册资金 : </label> 
							 <input class="input" type="text"  th:value="${currentUser.tCompany.registeredCapital}" name="registeredCapital" id="registeredCapital"/>
							
						</p>
						<p>
							<label for=""><strong>*</strong>组织机构代码 : </label> 
							<input class="input" type="text"  th:value="${currentUser.tCompany.organizationCode}" name="organizationCode" id="organizationCode"/>
							
						</p>
						<p>
							<label for=""><strong>*</strong>税务登记号 : </label> 
							
							<input class="input" type="text" th:value="${currentUser.tCompany.taxNo}" name="taxNo" value="taxNo"/>
							
						</p>
						<div class="div-box clearfix">
							<label class="label-title" for=""><strong>*</strong>是否一般纳税人
								: </label>
							<div class="div-box-right">
								<p>
										<label for="">
										<input type="checkbox"   value="1" name="isGeneralTaspayer" th:if="${currentUser.tCompany.isGeneralTaspayer==1}" checked="checked"/>
										<input type="checkbox"   value="1" name="isGeneralTaspayer" th:if="${currentUser.tCompany.isGeneralTaspayer!=1}" />  是
										</label> 
										<label for="">
										<input type="checkbox"  value="2" name="isGeneralTaspayer" th:if="${currentUser.tCompany.isGeneralTaspayer==0}" checked="checked"/> 
										<input type="checkbox"  value="2" name="isGeneralTaspayer" th:if="${currentUser.tCompany.isGeneralTaspayer!=0}" />否
										</label>
								
								</p>
							</div>
						</div>
						<p>
							<label for=""><strong>*</strong>企业营业执照 : </label> 
							<span class="span-label"><img src="../images/temp/pic_85x54_01.jpg" alt=""/></span>
						</p>
						<p>
							<label for=""><strong>*</strong>机构组织代码证 : </label> 
							<span class="span-label"><img src="../images/temp/pic_85x54_01.jpg" alt=""/></span>
						</p>
						<p>
							<label for=""><strong>*</strong>税务登记证 : </label> 
							<span class="span-label"><img src="../images/temp/pic_85x54_01.jpg" alt="" /></span>
						</p>
						<p>
							<label for=""><strong>*</strong>开户行名称 : </label> 
							
							<select  class="select w150" id="" >
				              <option th:each="bank : ${bankList}" th:value="${bank.id}" th:text="${bank.name}" th:if="${bank.name==currentUser.tCompany.bankName}" selected = "selected"></option>
				              <option th:each="bank : ${bankList}" th:value="${bank.id}" th:text="${bank.name}" th:if="${bank.name!=currentUser.tCompany.bankName}" ></option>
				            </select>
							
						</p>
						<p>
							<label for=""><strong>*</strong>开户行账号 : </label> 
							<input class="input" type="text" th:value="${currentUser.tCompany.bankAccount}" name="bankAccount" id="bankAccount"/>
						</p>
						
						<!-- <p>
                        <label for="">所属语言 : </label>
                        <select class="select" name="" id="">
                            <option value="">中文(简体)</option>
                            <option value="">English</option>
                        </select>
                   		 </p>-->
						
						<!--<p class="btn-bar">
							<label for=""></label> <span>
								<button class="btn btn-cyan" type="submit">修改资料信息</button>
							</span>
						</p>-->
						<p class="btn-bar">
							<label for=""></label> <span>
                            <button class="btn btn-cyan" type="submit">修改并返回上一级</button>
                        </span>
						</p>
						
					</form>
				</div>
			</div>
		</section>
	</article>
</body>
<script>
	//<![CDATA[
          function changProvince(obj){
        	    var provinceId = obj.options[obj.selectedIndex].value;
        	   /*  alert("The option you select is:"+opt.text+"("+opt.value+")"); */
					debugger;
           	    $.ajax({
       		        type:"GET",
       		        contentType: 'application/json', 
       		        url:"/api/" + provinceId + "/city",        
       		        success: function(response){	
       		        	debugger;
       		        	var html = '';
       		        	$.each(response, function(i, item) {
       		        		html = html + '<option value="' + item.id + '">' + item.cityName + '</option>';
       		    	 	})
       		    	 	$("#tcity").html(html);
       		        }
       	    	});
          }
		//]]>
</script>           
<script data-main="../js/page/a1_register" src="../lib/requirejs/require.js"></script>

</html>